package main

import (
	"gitee.com/shijun123456/rpcVotes/test/server"
	"google.golang.org/grpc"
	"google.golang.org/grpc/reflection"
	"log"
	"net"
)

func main() {
	lis, err := net.Listen("tcp", ":6012")
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}
	s := grpc.NewServer()
	server.RegisterDownloadServer(s, &server.DownloadServerImpl{})
	server.RegisterLoginServer(s, &server.LoginServerImpl{})
	server.RegisterUploadServer(s, &server.UploadSeverImpl{})
	//注册服务端发射服务
	reflection.Register(s)
	s.Serve(lis)
}
